﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Text.RegularExpressions;

namespace TravelGate.Areas.Admin.Models
{
    public class Functions
    {
        public string TextCaption(string s, int n)
        {
            string[] caption = s.Split(new Char[] { ' ' });
            string text = "";
            for(int i=0; i<caption.Length-n;i++)
            {
                text += caption[i] + " ";
            }
            return text;
        }
        public string GenCode(string prefix, string suffix)
        {
            Random rand = new Random();
            string day = Convert.ToString(DateTime.Now.Day);
            string month = Convert.ToString(DateTime.Now.Month);
            string year = Convert.ToString(DateTime.Now.Year);

            return prefix+"-" + rand.Next(1000, 9999) + "-" + day + month + year +"-" +suffix;
            }

    }
}